<template>
	<div>
		<div v-show="true" class="" style="width: 100%;height: 100%; position:fixed;left:0;top:0;background-color: rgba(0,0,0,0.1);display: flex;justify-content: center;align-items: center;z-index: 350;">
		<mu-circular-progress :size="24" color="green500"/>
	</div>
	</div>
</template>

<script>
	export default {

		 mounted(){
			//获取版本号注释登录
				let that=this
	      		console.info('登录了')
	      		localStorage.token= this.$route.query.token
//	      	localStorage.token='832c6f99275d5f201424e6e65443f160'
	      		that.axios.post('/iyx/Login/tokenLogin',{
	      			'token':localStorage.token
//	      			'token':'a9a4e4d751563ced090d533e97ee4e33'
	      		}).then(function(response){
					if(response.data.erroInfo=='success'){
						localStorage.userNumber=response.data.uid
	           			localStorage.classId=response.data.classId
	           			localStorage.userName=response.data.studentName
	           			localStorage.userJurisdiction=JSON.stringify(response.data.MenuList)
						
	           			let redirect = decodeURIComponent(that.$route.query.redirect || '/index');
						console.info('zou')
	           			setTimeout(function(){
	           				that.gotoAddress({path:'index'})
	           			},1480)
	           			
	           		}else if(response.data.erroInfo=='登录失败'){
						that.$message({type: 'info',message: '登录失败',duration:1500});
	           			console.info(response.data.erroInfo)
	           		}
	      		}).catch(function(error){
	      			 console.log(error)
	      			 that.$message({type: 'info',message: '登录失败，请重新登录',duration:1500});
	      			 console.log('失败')
	      		})
  		},
  		methods:{
			gotoAddress(path){
				var self=this
				setTimeout(function(){
					self.$router.push(path)
				},200)
	      	}
		}
	}
	
</script>

<style>
</style>